#!/usr/bin/php
<?PHP
###########################################################
#                                                         #
# CA Auto Turbo Mode copyright 2017-2023, Andrew Zawadzki #
#                                                         #
###########################################################

require_once("/usr/local/emhttp/plugins/ca.turbo/include/helpers.php");
require_once("/usr/local/emhttp/plugins/ca.turbo/include/paths.php");

exec("/usr/local/sbin/update_cron");
$settings = getPluginSettings();
if ($settings['enabled'] == "yes") {
  logger("Starting CA Auto Turbo Mode");
  $descriptorspec = array(
    0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
    1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
    2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to
  );
  proc_open("/usr/local/emhttp/plugins/ca.turbo/scripts/auto_turbo.php",$descriptorspec,$pipes);
}
?>